interface ProductA {
    public void info();
}

interface ProductB{
    public void info();
}

class ProductA1 implements ProductA {
    @Override
    public void info()
    {
        System.out.println("ProductA1");
    }

}

class ProductB1 implements ProductB {
    @Override
    public void info()
    {
        System.out.println("ProductB1");
    }
}

class ProductA2 implements ProductA {
    @Override
    public void info()
    {
        System.out.println("ProductA2");
    }

}

class ProductB2 implements ProductB {
    @Override
    public void info()
    {
        System.out.println("ProductB2");
    }
}

interface Factory {
    public ProductA createProductA();
    public ProductB createProductB();
}

class FactoryA1 implements Factory {
    @java.lang.Override
    public ProductA1 createProductA() {
        return new ProductA1();
    }
    public ProductB1 createProductB() {
        return new ProductB1();
    }
}

class FactoryA2 implements Factory {
    @java.lang.Override
    public ProductA2 createProductA() {
        return new ProductA2();
    }
    public ProductB2 createProductB() {
        return new ProductB2();
    }
}


class test {
    public static void main(String[] args) {

            FactoryA1 A = new FactoryA1();
            A.createProductA().info();

            FactoryA2 B = new FactoryA2();
            B.createProductB().info();

    }
}